from langgraph.prebuilt import create_react_agent
from langgraph.checkpoint.memory import MemorySaver
from common.QwenLLm import QwenLLM

llm = QwenLLM()
memory = MemorySaver()
def get_weather(city:str) -> str :
    """get weather from city"""
    return f"f{city}天气晴朗"

agent = create_react_agent(model=llm.client,tools=[get_weather])
mess=agent.invoke(
    {"messages":[{"role":"user","content":"今天上海天气如何？"}]}
)
for msg in mess:
    print(msg)